package com.btkjgc.controller;

import javax.servlet.http.HttpServletRequest;

import com.btkjgc.controller.api.JSONRequestCode;
import com.btkjgc.controller.api.JSONResponseVersion;
import com.btkjgc.utils.LogUtils;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * Created by Administrator on 14-2-25.
 */
@Controller
@RequestMapping("api")
public class AppController
{
	@RequestMapping(value = "app/lastest_version", method = RequestMethod.POST)
	public @ResponseBody
	JSONResponseVersion lastestVersion(HttpServletRequest httpServletRequest,
			@RequestBody JSONRequestCode request)
	{

		try
		{
			JSONResponseVersion response = new JSONResponseVersion("", 0, "");

			response.setVersion("1.8");
			response.setNumber("33");
			response.setUrl("http://www.botann.com:8081/app/BatteryDisplay.apk");

			return response;
		}
		catch (Exception ex)
		{
			LogUtils.error(ex);
		}
		return new JSONResponseVersion("", 0, "");
	}

}
